﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CourseUtils;

namespace max_min_divisor
{
    public class Program
    {
        public static int ReturnMaxDivisor(int a)
        {
            int n = a - 1;

            for (int i = n; n < a; n--)
            {
                if ((a % n) == 0)
                {
                    return n;
                }
            }

            return a;
        }

        public static int ReturnMinDivisor(int a)
        {
            int x = 2;

            for (int i = x; x < a; x++)
            {
                if ((a % x) == 0)
                {
                    return x;
                }
            }
            return x;
        }
        static void Main(string[] args)
        {
            int a = IOHelpers.ReadIntFromConsole("enter a number");
            int max = ReturnMaxDivisor(a);
            int min = ReturnMinDivisor(a);
            Console.WriteLine(max);
            Console.WriteLine(min);

            Console.ReadKey();
        }
    }
}
